/*两个树的左/右先序遍历相等
struct TreeNode {
    int val;
    struct TreeNode *left;
    struct TreeNode *right;
    TreeNode(int x) :
            val(x), left(NULL), right(NULL) {
    }
};
*/
class Solution {
public:
    bool isSymmetrical(TreeNode* pRoot)
    {
  		travelRight(pRoot);
  		travelLeft(pRoot);
  		if(equal(vr.begin(),vr.end(),vl.begin()))
  			return true;
  		return false;

    }

    void travelRight(TreeNode *p)
    {
    	if(p == nullptr)
		{
    		vr.push_back("#");
    		return;
    	}
    	vr.push_back(to_string(p->val));
    	travelRight(p->right);
    	travelRight(p->left);

    }

	void travelLeft(TreeNode *p)
    {
    	if(p==nullptr)
    	{
    		vl.push_back("#");
    		return;
    	}
    	vl.push_back(to_string(p->val));
    	travelLeft(p->left);
    	travelLeft(p->right);
    }

private:
	vector<string> vr;
	vector<string> vl;
    


};